﻿@model IEnumerable<iDMS.Models.Sheet>
@using MvcHtmlHelpers
<table style="margin-top: 20px">
    <tr>
        <th>
        </th>
        <th>
        </th>
        <th>
            Drawing
        </th>
        <th>
            Page
        </th>
        <th>
            Revision
        </th>
        <th>
            Format
        </th>
        <th>
            Carrier
        </th>
        <th>
            Status
        </th>
        <th>
            Date
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.SheetDownloadActionLink(item)
            </td>
            <td>
                @Html.AttachmentListActionLink(item)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Drawing.Identifier)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.PageNmb)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.RevisionSymbol)
            </td>
            <td title="@item.SheetFormat.FullName">
                @Html.DisplayFor(modelItem => item.SheetFormat.ShortName)
            </td>
            <td title="@item.InformationCarrier.Name">
                @Html.DisplayFor(modelItem => item.InformationCarrier.ShortName)
            </td>
            <td title="@item.SheetLifeCycleStatuse.Description">
                @Html.DisplayFor(model => item.SheetLifeCycleStatuse.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CreateDate)
            </td>
            <td id="list">
                @if (!ViewBag.FromDC)
                {
                    if (item.LifeCycleStatusID == 1)
                    {
                        @Html.ActionLink("Upload", "SheetUpload", new { id = item.ScheetID }, new { @class = "pol" })
                        @Html.ActionLink("Delete", "SheetDelete", new { id = item.ScheetID }, new { @class = "pol" })
                    
                    }
                    if (item.LifeCycleStatusID == 4 || item.LifeCycleStatusID == 6)
                    {
                        @Html.ActionLink("New Revision", "SheetReplace", new { id = item.ScheetID }, new { @class = "pol" })
                    }
                    if (item.LifeCycleStatusID == 4)
                    {
                        @Html.ActionLink("Withdrawn", "SheetWithdrawn", new { id = item.ScheetID }, new { @class = "pol" })
                    }
                }
            </td>
        </tr>
    }
</table>
<script type="text/javascript">
    $(function () {
        $("a.pol").button();

    });
</script>
